package com.gmail.bogatyr.alexander.controller;

import com.gmail.bogatyr.alexander.entity.Group;
import com.gmail.bogatyr.alexander.service.GroupService;

import java.util.Collection;

/**
 * This class represents...
 */
public class GroupController {

    private GroupService groupService = new GroupService();
    private Group group;

    public GroupController() {
        this.group = new Group();
//        this.group.setId(1L);
        this.group.setName("Test");
        this.group.setDescription("Test Group");
    }

    public Long createGroup() {
        return groupService.save(group);
    }

    public Group readGroup() {
        return groupService.findById(1l);
    }

    public Collection<Group> findAll() {
        return groupService.findAll();
    }
}
